<?php
/**
 * <https://y.st./>
 * Copyright © 2017 Alex Yst <mailto:copyright@y.st>
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <https://www.gnu.org./licenses/>.
**/

$xhtml = array(
	'<{title}>' => 'Windows has a separate command prompt for administrative activities.',
	'takedown' => '2017-11-01',
	'<{body}>' => <<<END
<section id="university">
	<h2>University life</h2>
	<p>
		Mostapha tried to help me today, and opened up that remote virtual machine, but the required Windows application seems to be failing due to permission errors, despite my having followed the assignment instructions to the letter.
		I greatly suspect that an administrative account is required for this assignment.
		That means that not only is the school assuming I have Windows, but they&apos;re also assuming I have administrative rights, meaning it&apos;s not a shared machine.
		Or at least, if it <strong>*is*</strong> a shared machine, I&apos;m the owner of it.
		I posted in the class forum, hoping someone else would have some insight.
		And they did.
		They&apos;d done the assignment already, and could confirm that root access was required.
		They offered me a screenshot to use for the assignment, saying they didn&apos;t see any reason I had to actually run the command myself.
		I&apos;d like to try to get this right though if I can.
		And from the screenshot, I found an important piece of information: Windows has a separate command prompt for administrative activities.
		I was using the regular command prompt, as I thought it was the only one.
		In the Linux world, we use <code>sudo</code> or (rarely) <code>su</code> for administration, so I didn&apos;t even think to look for a second command prompt on the Windows system.
		Windows is so foreign to me.
		It&apos;s not my fault I don&apos;t want that system on my home machine though.
		Even if I didn&apos;t care about freedom, Windows doesn&apos;t <strong>*function*</strong>.
		Just yesterday, my cash register at work crashed on me because the new registers are running Windows.
		They constantly have problems, and this just happens to have been the worst case I&apos;ve seen of that yet.
		Then today, the computer that prints out the barcode labels failed on us.
		In order to get the software running again, we had to reboot the whole machine.
		Seriously!?
		How broken is that!
		I&apos;m going to try getting my own screenshot again though when Mostapha and I have the time.
	</p>
	<p>
		The reading assignment in <span title="Web Programming 1">CS 2205</span> this week seems to be the introductory section of the $a[PHP] manual and a the introductory tutorial on $a[PHP] by W3Schools.
		I&apos;ll pass on the reading then.
		I think I&apos;ve read the W3Schools tutorial a couple times before, though it&apos;s been a while.
		$a[PHP] is my native language though, and W3Schools has a tendency not to teach exactly the best practices.
		I&apos;ve read the introductory section in the $a[PHP] manual countless times.
		Time is short, and I don&apos;t have time to go back and reread about things I already know very well, especially when there&apos;s no chance of new insight in the reading material, as I&apos;ve already seen what it has to say.
		I wrote up my discussion post for that course though:
	</p>
	<blockquote>
		<h3>Popularity</h3>
		<p>
			According to Gerard Millares (Millares, 2015), $a[PHP] is used as the server-side programming language by 75% of top websites.
			That makes it, by a wide margin, the most-popular server-side programming language used on the Web.
			Having been a $a[PHP] programmer for over five years, I can see a number of likely reasons for this.
		</p>
		<p>
			First and foremost, the $a[PHP] interpreter is freely-licensed.
			If you want to run a copy of it, you can, with very little restriction.
			(The main restriction is that if you modify the interpretor, you&apos;re required to give credit for the original code to the $a[PHP] developers and you have to admit that your version is modified.
			In other words, you can pretty much do whatever you want with the interpretor as long as you&apos;re honest about it.)
			Most people don&apos;t host their own websites, but this lack of ridiculous license keys and freedom to do as you like has caused many commercial Web hosts to make $a[PHP] available as a part of their services.
			Being widely available on Web hosts, $a[PHP] has become popular with people developing server scripts, such as WordPress.
			This has made a large number of server scripts written in $a[PHP] available, so users waning to use these scripts have to find a host that offers $a[PHP] as a part of their service.
			This has caused $a[PHP] to be in-demand, giving Web hosts more reason to provide it.
			And with it being so easy and inexpensive to provide $a[PHP] to their customers, there&apos;s really no reason for them not to comply.
			This creates a sort of feedback loop, where the more widely-available $a[PHP] is, the more scripts are written for it, and the more scripts that are written in $a[PHP], the more in-demand $a[PHP] becomes.
		</p>
		<p>
			Secondly, $a[PHP] is an interpreted language, not a compiled language.
			Editing your scripts causes an immediate change in the website.
			This ease of update makes it popular with newbies and veterans alike.
		</p>
		<p>
			Third, $a[PHP] integrates very nicely with the Apache Web Server, a very popular Web server daemon.
			Web $a[CGI] often generates a lot of overhead, as the $a[CGI] software gets started at the beginning of each request and shut down at the end of it.
			Server plugins can help with that though, so the $a[CGI] software is running all the time and can service requests on the fly.
			$a[PHP] is the only $a[CGI] software with an official plugin for Web servers that I know of, and the plugin is for the popular Apache Web Server.
			Third-party plugins for other languages and other Web servers exist, but you just don&apos;t have the same level of ease and support as when your $a[CGI] software is specifically built to function with the plugin.
		</p>
		<p>
			And fourth, the $a[PHP] language is set up such that it naturally embeds into plain text files.
			As I&apos;ve moved away from $a[PHP] for Web scripting and towards $a[PHP] for general-purpose scripting, I&apos;ve found this feature to be very strange.
			However, if you&apos;re using $a[PHP] on the Web, it can save a lot of <code>echo</code> statements and make your code a bit more clear.
		</p>
		<h3>Recognizing $a[PHP]</h3>
		<p>
			There are a number of ways to tell if a given webpage is running $a[PHP].
			First, if the <code>.php</code> file extension is used, it&apos;s probably a $a[PHP] script.
			In practice, this is a good indicator, though in theory, it&apos;s completely possible for a Web server administrator to map the <code>.php</code> extension (or any other extension) to whatever they want to.
			People like to be consistent though, so they usually map extensions to what everyone else does.
			You can also pass a $a[PHP] script certain special query strings that cause $a[PHP] to take over and not run the script at all.
			These cause $a[PHP] to instead output its logo as a $a[PNG].
			This feature can be disabled though, so again, it doesn&apos;t work across the board.
			In theory, you could also program this feature into a non-$a[PHP] $a[CGI] interpreter.
			Third, you might recognise certain Web applications.
			If you see WordPress and you know what WordPress is, you know you&apos;re dealing with $a[PHP] scripts.
		</p>
		<h3>Server-side scripting as a requirement</h3>
		<p>
			The third question of this discussion assignment seems like a trick question to me:
		</p>
		<blockquote>
			<p>
				Why do you think that most web pages today require server side programming?
			</p>
		</blockquote>
		<p>
			The fact is, I <strong>*don&apos;t*</strong> think most webpages require server-side programming.
			Most pages are informational; they don&apos;t need to be dynamic in any way.
			They use it anyway, but they don&apos;t actually need to, and they could get the same results (or sometimes better results, if they misuse server-side programming) using static pages.
			For example, some websites use server-side scripting to produce page redirects based on $a[IP] address.
			If you&apos;re refusing to show certain pages to certain $a[IP] addresses, you&apos;re doing something wrong.
			<strong>*Suggesting*</strong> a different page based on $a[IP] address is harmless, but forcibly preventing a user from accessing the page they actually requested is problematic for users.
			I deal with this garbage on a regular basis, and it&apos;s often because a website mis-guesses what country I&apos;m in and wants to show me a page with, for example, the wrong currency units, often on a separate website with a different $a[TLD].
			Oddly enough, I&apos;m often able to switch to any country-based version of the website I want to <strong>*except*</strong> the one I actually need, as the United-States-based version of the website is the <strong>*only*</strong> one that redirects.
			With no way to get the price in $a[USD], I leave and they lose my business.
			Another server-side scripting problem is when the server tries to guess what your client is using the <code>User-Agent</code> header and sends a different page based on it.
			If you use $a[XHTML] and $a[CSS] correctly, the Web browser can adjust the look of the page as needed to fit the size of the screen.
			I&apos;ve seen websites drastically change in layout when you resize the window!
			However, when you try to do this based on the <code>User-Agent</code> header, you&apos;re going to run into <code>User-Agent</code> strings you don&apos;t recognise, and you&apos;re going to mis-guess at least some clients.
			<strong>As an absolute, no exceptions *rule*, if you&apos;re using the <code>User-Agent</code> header to reformat your page in *any* way, you&apos;re doing something *drastically* wrong!</strong>
		</p>
		<p>
			That said, while server-side scripting <strong>*is not*</strong> a requirement in most cases, it&apos;s still a very useful tool.
			For example, a page template can be set up, so all pages of the website share the same look and feel.
			When the template is updated, every page appears to be updated to match.
			It adds consistency, uniformity, and professionalism.
		</p>
		<p>
			In addition to information-class pages, there are also Web application pages, which do actually need server-side scripting.
			Anything with a login form is going to need some server-side scripting.
			For that matter, anything with <strong>*any*</strong> sort of form is going to need some server-side scripting to back it up; otherwise, what you enter in the form won&apos;t actually be used for anything.
			Websites such as the University of <span class="redacted">[REDACTED]</span>&apos;s classroom website use server-side scripting to allow submission of work.
			They also use it to prevent students from reading the assignments of courses they haven&apos;t enrolled in and thus won&apos;t be paying for.
			A Web forum website uses server-side scripting to accept posts by users and display them to other users.
			A shopping website keeps track of what items are in the cart and take payment information.
			Server-side scripting can be very useful, and is necessary for Web applications, but isn&apos;t necessary for most pages at large.
		</p>
		<h3>More than just client-side scripts</h3>
		<p>
			Not everyone has JavaScript enabled, and it can irritate and annoy your users to demand that they enable it.
			Most of the time, if a website requires JavaScript to function, I leave and find a better website to work with instead.
			Server-side scripting is more reliable and more user-friendly in this way.
		</p>
		<p>
			You can also access privileged data from the server that you can&apos;t on the client.
			For example, you could create a website complete with a login system entirely in JavaScript and $a[XHTML] using $a[AJAX].
			However, said system would need to, on the client side, need to be able to look up the password hashes (You <strong>*are*</strong> at least hashing your passwords, right?), then once verified, would need to load data for a particular user.
			However, the client could modify the script so it <strong>*bypasses*</strong> the password hash check!
			In that way, privileged account information could be accessed by anyone, and with extreme ease.
		</p>
		<p>
			Additionally ...
			If you&apos;re <strong>evil</strong>, you might not want users to see and understand your code.
			With client-side scripting, the user has access to your entire script (like they should).
			If you wanted to hide how your website works, you could run it on your server instead of their client.
		</p>
		<h3>Side notes</h3>
		<p>
			You may have noticed I mark up all my acronyms in my posts.
			For example, if you hover your mouse over the word &quot;$a[CGI]&quot;, you can see it stands for &quot;Common Gateway Interface&quot;.
			I actually don&apos;t even do that all by hand; I use $a[PHP] to compile my posts before I submit them!
		</p>
		<div class="APA_references">
			<h3>References:</h3>
			<p>
				Millares, G. (2015, November 17). Top 5 Programming Languages Used In Web Development : Programming and Development Blog | Stone River eLearning. Retrieved from <a href="http://blog.stoneriverelearning.com/top-5-programming-languages-used-in-web-development/"><code>http://blog.stoneriverelearning.com/top-5-programming-languages-used-in-web-development/</code></a>
			</p>
		</div>
	</blockquote>
</section>
<section id="docmod">
	<h2>Document modifications</h2>
	<p>
		On <a href="/en/weblog/2017/11-November/02.xhtml">2017-11-02</a>, this journal page was modified in order to redact the name of the university.
	</p>
</section>
END
);
